<%@ page contentType="text/html;charset=UTF-8" language="java"%>
<html>
<head>
    <meta charset="UTF-8">
    <title>...</title>
    <script src="webjars/jquery/3.6.0/dist/jquery.min.js"></script>
    <link rel="stylesheet" href="webjars/bootstrap/3.4.1/css/bootstrap.min.css">
    <script src="webjars/bootstrap/3.4.1/js/bootstrap.min.js"></script>
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        table{
            border: 1px solid dodgerblue;
            text-align: center;
        }
        td{
            border:1px solid dodgerblue;
            width: 200px;
        }
        #sentForm table{
            text-align: left;
            margin-top: 50px;
        }
        #sentForm td{
            width: 400px;
        }
    </style>
</head>
<body>
    <table>
        <tr><td colspan="6" bgcolor="#1e90ff" align="left"><b>列表显示</b></td></tr>
        <tr>
            <td><b>编号</b></td>
            <td><b>板块名称</b></td>
            <td><b>标题</b></td>
            <td><b>发布人</b></td>
            <td><b>发表时间</b></td>
            <td><b>操作</b></td>
        </tr>
        <tbody id="tb"></tbody>
    </table>
    <form action="#" id="sentForm">
        <table>
            <tr>
                <td>标题：<input type="text"/></td>
                <td>发表人：<input type="text"/></td>
                <td>发表时间：<input type="date"/></td>
            </tr>
            <tr>
                <td colspan="3">
                    选择所属板块：<select>
                                        <option>JSP编程技术</option>
                                        <option>JAVA编程技术</option>
                                        <option>HTML网页技术</option>

                                </select>
                </td>
            </tr>
            <tr>
                <td colspan="3">内容：</td>
            </tr>
            <tr>
                <td colspan="3">
                    <textarea></textarea>
                </td>
            </tr>
            <tr>
                <td colspan="3" align="center">
                    <button type="button">修改</button>
                    <button type="reset">返回</button>
                </td>
            </tr>
        </table>
    </form>

</body>
</html>
<script>
    $(function () {
        getAll();
    })
    function getAll() {
        $.get("/getAll.do",function (data) {
            $("#tb").html("");
            console.log("data:",data);
            let str="";
            data.forEach(all=>{
                str += "<tr>";
                str += "<td>"+all.tid+"</td>";
                str += "<td>"+all.publisherName+"</td>";
                str += "<td>"+all.titleContent+"</td>";
                str += "<td>"+all.pubAuthor+"</td>";
                str += "<td>"+all.pubTime+"</td>";
                str += "<td>";
                str += "<a href='#'>修改</a>";
                str += "</td>";
                str += "</tr>";
            })
           $("#tb").html(str);
        });
    }
</script>